<template>
  <div class="more-list">
    <div class="wrapper">
      <backtop/>
      <h3>{{ this.$route.params.title }}</h3>
      <router-link class="info url log" 
      v-for="(item,index) in moreKingData" 
      :key="index"
      :to="{name:'MorePlayList',params:{id: item.id,img: item.coverImgUrl,name: item.name,description: item.description}}" >
        <div class="poster" :title="item.name">
          <img :src="item.coverImgUrl" :title="item.name" ref="image" />
        </div>
        <div class="text-wrap">
          <div class="title" ref="text" >{{ item.name }}</div>
        </div>
      </router-link>
    </div>
    <div>
      <p>更多榜单敬请期待~</p>
    </div>
  </div>
</template>

<script>
export default {
  name: "moreList",
  data() {
    return {
      moreKingData: [],
    };
  },
  mounted() {
    // musicType: 3：音乐榜单
    const url = this.HOST+"/toplist/detail";
    this.$axios.get(url)
      .then(res => {
        this.moreKingData = res.data.list;
      })
      .catch(err => console.log('音乐榜单报错', err.response.data.message))
  }
};
</script>

<style scoped>
.wrapper {
  padding-top: 13px;
  text-align: center;
  margin-bottom: 10px;
  background: #fff;
  clear: both;
  overflow: hidden;
  margin: 10px auto;
  position: relative;
}

h3 {
  font-size: 22px;
  text-align: left;
  margin: 15px;
}

.wrapper .info {
  width: 40%;
  float: left;
  text-align: center;
  padding-left: 20px;
  display: block;
  text-align: left;
  margin-bottom: 22px;
  margin: 20px auto;
  position: relative;
}

.wrapper .info .text-wrap {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: 100%;
  font-size: 16px;
  text-align: center;
}

div p {
    text-align: center;
}
</style>